package org.naxx.security.xgen.util;

import java.util.concurrent.atomic.AtomicLong;

/**
 * There must not be more than one instance of this class
 * per application.
 */
public final class JavaNameGenerator {
	
	private final AtomicLong counter = new AtomicLong(0);
	
	public JavaNameGenerator() {
	}

	public String getNextUniqueVariableName() {
		return "var" + this.counter.getAndIncrement();
	}
	
	public String getNextUniqueClassNameSuffix() {
		return "_" + System.currentTimeMillis() + "_" + this.counter.getAndIncrement();
	}
}
